import 'dart:async';

typedef void DebounceCallback();

class UtilsDebouncer {
  final int delay;
  Timer? _timer;

  UtilsDebouncer({this.delay = 1500});

   void debounce(DebounceCallback callback) {
    _timer?.cancel();
    _timer = Timer(Duration(milliseconds: delay), callback);
  }
}

